using Lzfy_His_Service.Models;
using System.Data;

namespace Lzfy_His_Service.Repositories
{
    public interface IRefundTaskDetailRepository
    {
        Task<RefundTaskDetail?> GetByIdAsync(long id);
        Task<IEnumerable<RefundTaskDetail>> GetAllAsync();
        Task<IEnumerable<RefundTaskDetail>> GetByMasterIdAsync(long masterId);
        Task<IEnumerable<RefundTaskDetail>> GetByMasterIdsAsync(IEnumerable<long> masterIds);
        Task<(IEnumerable<RefundTaskDetail> data, int totalCount)> GetWithFilterAsync(
            long? masterId = null,
            string? patientId = null,
            string? patName = null,
            string? phoneNumber = null,
            int? contactCount = null,
            DateTime? startDate = null,
            DateTime? endDate = null,
            int pageIndex = 1,
            int pageSize = 20);
        Task<IEnumerable<RefundTaskDetail>> GetByPatientIdAsync(string patientId);
        Task<long> CreateAsync(RefundTaskDetail refundTaskDetail);
        Task<long> CreateAsync(RefundTaskDetail refundTaskDetail, IDbConnection connection, IDbTransaction? transaction = null);
        Task<bool> UpdateAsync(RefundTaskDetail refundTaskDetail);
        Task<bool> UpdateAsync(RefundTaskDetail refundTaskDetail, IDbConnection connection, IDbTransaction? transaction = null);
        Task<bool> DeleteAsync(long id);
        Task<bool> DeleteByMasterIdAsync(long masterId);
        Task<bool> UpdateContactTimeAsync(long id, DateTime contactTime);
        Task<bool> BatchCreateAsync(IEnumerable<RefundTaskDetail> details);
        Task<bool> BatchCreateAsync(IEnumerable<RefundTaskDetail> details, IDbConnection connection, IDbTransaction? transaction = null);
        Task<IEnumerable<RefundTaskDetail>> GetHisRefundDataAsync(int? maxCount = null);
        
        Task<bool> ExistsByAccountIdAsync(string? accountId, IDbConnection connection, IDbTransaction? transaction = null);
    }
}